package com.ruyuan.controller;

import org.apache.catalina.security.SecurityUtil;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author xx
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/index")
//    @RequiresRoles("admin")
    public String index() {
        SecurityUtils.getSubject().checkRole("admin");
        return "user";
    }

    @RequestMapping("/del")
//    @RequiresPermissions("user:del")
    public String del() {
//        SecurityUtils.getSubject().isPermitted("user:del");
        return "del";
    }

}
